import { type AtomType } from "../atom/atom"; /** The three possible theme values a user can choose. */ export type ThemeValue = "light" | "dark" | "auto"; /** * A reactive theme atom extended with convenience mutators and a pre-resolved * `resolved` getter. * * Inherits the full `AtomType` interface — callable, `.get()`, * `.set()`, `.val`, `.__subscribe()`, `.__version__`, etc. — plus * theme-specific helpers: * * - `setToLight()` — force light mode and persist choice. * - `setToDark()` — force dark mode and persist choice. * - `setToAuto()` — follow OS preference, removes stored key. * - `toggle()` — flip between "light" and "dark"; resolves OS preference * first if currently "auto"; result is always explicit. * - `resolved` — the effective theme, always "light" or "dark". */ export type ThemeAtomType = AtomType & { /** Explicitly set theme to "light" and persist to localStorage. */ setToLight(): void; /** Explicitly set theme to "dark" and persist to localStorage. */ setToDark(): void; /** Follow the OS color-scheme preference. Removes localStorage key. */ setToAuto(): void; /** * Toggle between "light" and "dark". * If currently "auto", resolves OS preference first, then flips. * After toggle the theme is always explicit (never "auto"). */ toggle(): void; /** The resolved theme — always "light" or "dark", never "auto". */ readonly resolved: "light" | "dark"; readonly name: "themeAtom"; }; /** * Creates a reactive theme atom. * * - Reads the initial theme from `localStorage["mates-theme"]`. * - Falls back to the OS color-scheme preference when no value is stored. * - Keeps `` in sync automatically via an internal effect. * - Persists changes to localStorage (removes key for "auto"). * - Re-applies the resolved theme when the OS preference changes while in * "auto" mode. */ export declare const createThemeAtom: () => ThemeAtomType; //# sourceMappingURL=themeAtom.d.ts.map